<template>
  <ul class="my_list">
      <li v-for="(item,index) in childrenList" :key="index" @click="jump(item)">
          <h4>{{item.name}}</h4>
          <p>{{item.address}}</p>
      </li>
  </ul>
</template>
<script>
import { ref, reactive, toRefs } from "vue";
import { useStore } from 'vuex';
import { useRouter } from 'vue-router';
export default {
  props:{
    childrenList: Array
  },
  setup() {
    const { commit } = useStore();
    const { push } = useRouter();
    const jump = (val) => {
      commit('addHistory',val);
      push(`/home/index?geohash=${val.geohash}`);
    }
    return {
      jump
    }
  },
};
</script>
<style lang="scss" scoped>
  .my_list{
    height: calc(100% - 164px);
    overflow: auto;
    li{
        padding: 10px;
        border-bottom: 1px solid #e9e9e9;
        background: #fff;
        p{
          font-size: 12px;
          color: #ccc;
        }
    }
  }
</style>
